package org.example.game.history;

import java.util.Arrays;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/06/23 11:01
 */
public class Solution100342 {

    public static void main(String[] args) {
        Solution100342 solution = new Solution100342();
        System.out.println(solution.minimumAverage(new int[]{1,9,8,3,10,5}));
    }

    public double minimumAverage(int[] nums) {
        Arrays.sort(nums);
        double ans = Double.MAX_VALUE;
        int n = nums.length;
        for (int i = 0; i < n/2; i++) {
            ans = Math.min(ans, new Double(nums[i] + nums[n-i-1])/2);
        }
        return ans;
    }
}
